#ifndef HPLC_ZKYS_PROTOCOLCOMMON_H
#define HPLC_ZKYS_PROTOCOLCOMMON_H

#include "base/baseprotocol.h"
#include "common/hplczkyssendcommonsystempacket.h"
#include "common/hplczkyscheckpacket.h"
#include "common/hplczkysparsecommonpacket.h"
#include "common/hplczkysparsecommonsystempacket.h"

#include "modulehplcdefine.h"

namespace hplc
{
namespace zkys
{

class HplcZkysProtocolCommonData;
class HplcZkysProtocolCommon : public ::BaseProtocol
{
	Q_OBJECT
public:
    HplcZkysProtocolCommon(CommonParam &param, QObject *parent = nullptr);
    virtual ~HplcZkysProtocolCommon() override;

    virtual bool setConfig(int id, const QVariant &var) override;
    virtual bool getConfig(int id, QVariant &var) override;

    virtual bool setProtocolCmd(int id, QVariant &var) override;
    virtual bool getProtocolCmd(int id, QVariant &var) override;

    HplcZkysCheckPacket *getChecker();
    HplcZkysParseCommonPacket *getCommonParser();
    HplcZkysParseCommonSystemPacket *getCommonSystemParser();
    HplcZkysSendCommonPacket *getCommonSender();
    HplcZkysSendCommonSystemPacket *getCommonSystemSender();

public slots:
    virtual void setModel(quint8 model);

    virtual void onBaseTickTimeout() override;

protected:
    explicit HplcZkysProtocolCommon(HplcZkysProtocolCommonData &data, CommonParam &param, QObject *parent = nullptr);
};

} // zkys
} // hplc

#endif // HPLC_ZKYS_PROTOCOLCOMMON_H
